model_config:
  class_name: tensorflow_asr.models.ctc.jasper>Jasper
  config:
    name: jasper
    speech_config:
      sample_rate: 16000
      frame_ms: 25
      stride_ms: 10
      nfft: 512
      num_feature_bins: 80
      feature_type: log_mel_spectrogram
      log_base: "10"
    dense: True
    first_additional_block_channels: 256
    first_additional_block_kernels: 11
    first_additional_block_strides: 2
    first_additional_block_dilation: 1
    first_additional_block_dropout: 0.2
    nsubblocks: 3
    block_channels: [ 256, 384, 512, 640, 768 ]
    block_kernels: [ 11, 13, 17, 21, 25 ]
    block_dropout: [ 0.2, 0.2, 0.2, 0.3, 0.3 ]
    second_additional_block_channels: 896
    second_additional_block_kernels: 1
    second_additional_block_strides: 1
    second_additional_block_dilation: 2
    second_additional_block_dropout: 0.4
    third_additional_block_channels: 1024
    third_additional_block_kernels: 1
    third_additional_block_strides: 1
    third_additional_block_dilation: 1
    third_additional_block_dropout: 0.4
    blank: 0
    vocab_size: {{decoder_config.vocabsize}}
    kernel_regularizer:
      class_name: l2
      config:
        l2: 1e-6

learning_config:
  optimizer_config:
    class_name: Adam
    config:
      learning_rate: 0.001
      beta_1: 0.9
      beta_2: 0.98
      epsilon: 1e-9

  gwn_config: null

  gradn_config: null

  batch_size: 16
  ga_steps: 4
  num_epochs: 450

  callbacks:
    - class_name: tensorflow_asr.callbacks>TerminateOnNaN
      config: {}
    - class_name: tensorflow_asr.callbacks>ModelCheckpoint
      config:
        filepath: {{modeldir}}/checkpoints/{epoch:02d}.weights.h5
        save_best_only: False
        save_weights_only: True
        save_freq: epoch
    - class_name: tensorflow_asr.callbacks>TensorBoard
      config:
        log_dir: {{modeldir}}/tensorboard
        histogram_freq: 0
        write_graph: False
        write_images: False
        write_steps_per_second: False
        update_freq: batch
        profile_batch: 0
    - class_name: tensorflow_asr.callbacks>KaggleModelBackupAndRestore
      config:
        model_handle: {{kaggle_model_handle}}
        model_dir: {{modeldir}}
        save_freq: epoch

